const sequelize = require('sequelize');

module.exports = app => {
    const { STRING, INTEGER } = app.Sequelize;
    const Role = app.model.define('role', {
        id: { type: sequelize.INTEGER, primaryKey: true, autoIncrement: true },
        name: sequelize.STRING(1234),
        text: sequelize.STRING(1234),
        limit: {
            type: STRING,
            defaultValue: 'read,download'
        },
        overTime: {
            type: INTEGER,
            defaultValue: 30
        },
        visitMaxCount: {
            type: INTEGER,
            defaultValue: -1
        },
        roleId: {
            type: INTEGER
        },
    });

    return Role;
};